<cfcomponent>

<cffunction name="setAnnouncement" access="remote">
	<cfargument name="announcement" type="struct" required="Yes" />
	<cfargument name="dummy" type="string" required="No" />
	<cfquery name="setAnnouncement" datasource="#application.datasource#">
		EXEC setAnnouncement <cfif isDefined("arguments.announcement.id")>#arguments.announcement.id#<cfelse>NULL</cfif>, '#arguments.announcement.title#', '#arguments.announcement.description#';
	</cfquery>
</cffunction>

<cffunction name="getAnnouncements" access="remote">
	<cfquery name="getAnnouncements" datasource="#application.datasource#">
		EXEC getAnnouncements;
	</cfquery>
	<cfset events = arrayNew(1) />
	<cfloop from="1" to="#getAnnouncements.recordCount#" index="i">
		<cfset events[i] = structNew() />
		<cfset events[i].id = getAnnouncements.announcementId[i] />
		<cfset events[i].title = getAnnouncements.title[i] />
		<cfset events[i].description = getAnnouncements.description[i] />
		<cfset events[i].dateAdded = getAnnouncements.dateAdded[i] />
	</cfloop>
	<cfreturn events />
</cffunction>

</cfcomponent>